namespace WWB.SitePointPrivateMessages.Web.Models
{
    public class MessageSearchFormOptions
    {
        public MessageSearchFormOptions()
        {
            SelectedFolders = new string[0];
            SelectedUsers = new int[0];
            SearchTerm = string.Empty;
            IncludeUsers = true;
        }

        public bool IncludeUsers { get; set;}
        public string SearchTerm { get; set; }
        public string[] SelectedFolders { get; set; }
        public int[] SelectedUsers { get; set; }

        public bool IsEmpty
        {
            get
            {
                if (string.IsNullOrEmpty(SearchTerm)
                    && SelectedFolders.Length == 0
                    && SelectedUsers.Length == 0
                    && IncludeUsers)
                {
                    return true;
                }
                return false;
            }
        }
    }
}